<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8" import="java.sql.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>github使用教程</title>
</head>
<script type="text/javascript">
function printValue(){
		var s1=document.getElementsByName("button");
		alert(s1[0].value);}
</script>
<body>
	<input name="button" type="button" value="DukeSeraph" onclick="printValue()"/>
	<%
		String JDBC_DRIVER = "com.mysql.jdbc.Driver";
		String DB_URL="jdbc:mysql://localhost:3306/MedicalServiceSystem";
		String USER="soft";
		String PWD="123456";
		Connection conn=null;
		Statement stat=null;
		try{
			Class.forName("com.mysql.jdbc.Driver");
			conn = DriverManager.getConnection(DB_URL,USER,PWD);
			stat=conn.createStatement();
			String cmd="select * from medical";
			ResultSet res=stat.executeQuery(cmd);
			int id=0;
			while(res.next()&&id<20){
				id=res.getInt("ID");
				String name=res.getString("NAME_PHONETIC");
				String sex=res.getString("SEX");
				out.println(id+"-"+name+"-"+sex+"<br/>");
			}
			res.close();
			stat.close();
			conn.close();
		}catch(Exception e){
			
		}
	%>
</body>
</html>